FROM ubuntu:20.04

RUN apt-get -y update && apt-get -y upgrade && apt-get install ca-certificates -y

COPY ./containerfiles/ubuntu.tsinghua.mirror /etc/apt/sources.list 

RUN apt-get -y update && apt-get -y upgrade && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        git \
        clangd \
        clang \
        cmake \
        make  \
        gdb \
        openssh-server \ 
        libgtest-dev \ 
        libgmock-dev \ 
        # config ssh server
        && sed -E 's/^#(PermitRootLogin )no/\1yes/' /etc/ssh/sshd_config -i && ssh-keygen -A 

VOLUME /code

RUN mkdir /run/sshd

RUN ["/usr/sbin/sshd"]


